dojo.provide("uws.drawing.usecase.SystemBox");
dojo.require('uws.drawing.Component');

dojo.declare('uws.drawing.usecase.SystemBox',uws.drawing.Component,{
	constructor: function(surface,id,dx,dy, sortOrder,label,fromDS){
		this.center_x = 200;
        this.center_y = 100;
		this.sortOrder = sortOrder;
		
		if(fromDS){
			dx+=this.center_x;
			dy+=this.center_y;
		}
		
		this
		
		//resize handles
		this.tl_res = this.resize_shape_group.createRect({
			x:0,
			y:0,
			width:10,
			height:10
		}).setFill("white");
		
		this.tr_res = this.resize_shape_group.createRect({
			x:0,
			y:200,
			width:10,
			height:10
		}).setFill("white");
		
		this.bl_res = this.resize_shape_group.createRect({
			x:400,
			y:0,
			width:10,
			height:10
		}).setFill("white");
		
		this.br_res = this.resize_shape_group.createRect({
			x:400,
			y:200,
			width:10,
			height:10
		}).setFill("white");
		
		//actual shape
		this.actual_shape_group.createRect({
			x:4,
			y:5,
			width:400,
			height:200
		}).setStroke("black").setFill("white");
		
		this.label_shape = this.actual_shape_group.createText({
			text:label,
			x:this.center_x,
			y:(this.center_y-100+28),
			align:"middle"
		}).setFill("black").setFont(defaultFont);
		
		this._postCreate(dx, dy);
	},
	applyProperties:function(properties){
		this.label_shape.setShape({
			text: properties.label,
			x:this.center_x,
			y:(this.center_y-100+28),
			align:"middle"
		}).setFill("black").setFont(defaultFont);
	}
});